<template>
  <!-- 小弹框 width:500,height:0.3,top:15%  -->
  <!-- 中弹框 width:800,height:0.5,top:10% -->
  <!-- 大弹框 width:1060,height:0.76,top:5% -->

  <div class="Control-1 mechanism_dialogS closure" id="comcn small">
    <el-dialog
      width="1460px"
      title="理论配合比"
      v-dialogDrag
      :visible.sync="visible"
      @close="closeDialog"
      :append-to-body="true"
      top="5%"
    >
      <div
        class="dialogBody common commonClassDialog moduleDialog"
        id="longLable"
        :style="{ height: dialogHeight }"
        style="width: 100%"
      >
        <div style="overflow-y: auto; margin-bottom: 20px">
          <div class="baseTitle">理论配合比基本信息</div>
          <div style="height: 200px">
            <publicForm
              ref="publicForm"
              lableWidth="120px"
              :formObj="formObj"
              :formData="formData"
              @selectChange="selectChange"
              :timestamp="formData.fFileurl"
              :fileList="fileList"
              :selected="[]"
              @delteFile="delteFile($event, 0)"
            >
            </publicForm>
          </div>
          <!-- <div class="baseTitle">理论配合比原材料信息</div> -->
          <el-collapse v-model="activeNames" @change="changeCollapse">
            <el-collapse-item name="0" v-show="handNum">
              <!-- <el-collapse-item name="0" > -->
              <template slot="title">
                <div>
                  <img
                    style="vertical-align: middle"
                    src="@/assets/img/Supervision/com_flg.png"
                    alt=""
                  />
                  <span style="margin-left: 8px">理论配合比原材料信息</span>
                </div>
              </template>
              <div style="height: 180px; margin-top: 3px;overflow-y: auto;">
                <el-table :data="tableData" style="width: 100%">
                  <el-table-column label="序号" type="index" width="50">
                  </el-table-column>
                  <el-table-column
                    prop="fMaterialtypename"
                    label="材料种类"
                    align="center"
                  >
                    <template slot-scope="scope">
                      <div class="inputminute">
                        <el-input
                          :disabled="true"
                         
                          v-model="scope.row.fMaterialtypename"
                         
                        ></el-input>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column
                    prop="fMaterialname"
                    label="材料名称"
                    align="center"
                  >
                    <template slot-scope="scope">
                      <div class="selectobject">
                        <!-- {{scope.row}} -->
                        <el-select
                          placeholder="请选择"
                          v-model="scope.row.fMaterialname"
                          value-key="fId"
                          :disabled="isEdit"
                          @change="function (item) {
                              return selectMaterial(
                                scope.row,
                                scope.row.fMaterialname,
                                scope.$index,
                                item
                              );
                            }
                          "
                        >
                          <el-option
                            v-for="(item, index) in scope.row.specificationData"
                            :label="`${item.fMaterialname}`"
                            :value="item"
                            :key="index"
                            :disabled="item.disabled"
                          >
                          </el-option>
                        </el-select>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column
                    prop="fSpecification"
                    label="规格型号"
                    align="center"
                  >
                    <template slot-scope="scope">
                      <div class="selectobject">
                        <el-select
                          placeholder="请选择"
                          v-model="scope.row.fSpecification"
                          value-key="fId"
                          :disabled="isEdit"
                          @change="function (item) {
                              return selectSpecification(
                                scope.row,
                                scope.row.fSpecification,
                                scope.$index,
                                item
                              );
                            }
                          "
                        >
                          <el-option
                            v-for="(item, index) in scope.row.specifications"
                            :label="`${item.fVersion}`"
                            :value="item"
                            :key="index"
                            :disabled="item.disabled"
                          >
                          </el-option>
                        </el-select>
                      </div>
                    </template>
                  </el-table-column>
                  <el-table-column
                    prop="fSuppliername"
                    label="生产厂商"
                    align="center"
                  >
                    <template slot-scope="scope">
                      <div class="selectobject">
                        <el-select
                          placeholder="请选择"
                          v-model="scope.row.fSuppliername"
                          value-key="fId"
                          :disabled="isEdit"
                          @change="function (item) {
                              return selectPurveyor(
                                scope.row,
                                scope.row.fSuppliername,
                                scope.$index,
                                item
                              );
                            }
                          "
                        >
                          <el-option
                            v-for="(item, index) in scope.row.PurveyorData"
                            :label="`${item.fMerchantname}`"
                            :value="item"
                            :key="index"
                            
                          >
                          </el-option>
                        </el-select>
                      </div>
                    </template>
                  </el-table-column>
                  
                </el-table>
              </div>
            </el-collapse-item>

            <el-collapse-item name="1" v-show="firstNum">
              <template slot="title">
                <div>
                  <img
                    style="vertical-align: middle"
                    src="@/assets/img/Supervision/com_flg.png"
                    alt=""
                  />
                  <span style="margin-left: 8px">理论配合比</span>
                </div>
              </template>
              <div style="height: 160px; margin-top: 3px">
                <table style="width: 100%" >
                <tr class="typeMaterial" >
                  <td class="MaterialBoxname" >材料种类</td>
                  <td class="MaterialBoxs" v-for="item in tableData" :key="item.fId">{{item.fMaterialtypename}}</td>
                  <td class="MaterialBox">7天强度（MPa）</td>
                  <td class="MaterialBox">28天强度（MPa）</td>
                  <td class="MaterialBox">坍落度（mm）</td>
                </tr>
                <tr class="typeMaterial" >
                  <td class="MaterialBoxname" >材料名称</td>
                  <td class="MaterialBoxs1" v-for="item in tableData" :key="item.fId"><a href="javascript:void(0);" :title="item.fMaterialname">{{item.fMaterialname}}</a></td>
                  <td class="MaterialBox1" colspan="3"></td>
                  <td class="MaterialBox1" colspan="3"></td>
                  <td class="MaterialBox1" colspan="3"></td>
                </tr>
                <tr class="typeMaterial"  v-if="tableData[0]">
                  <td class="MaterialBoxname" >规格型号</td>
                  <td class="MaterialBoxs1" v-for="item in tableData" :key="item.fId">{{item.fSpecification}}</td>
                  <td class="MaterialBox1" colspan="3"><el-input   :disabled="isEdit" v-model="tableData[0].f7strength"></el-input></td>
                  <td class="MaterialBox1" colspan="3"><el-input   :disabled="isEdit" v-model="tableData[0].f28strength"></el-input></td>
                  <td class="MaterialBox1" colspan="3"><el-input   :disabled="isEdit" v-model="tableData[0].fTldstrength"></el-input></td>
                </tr>
                <tr class="typeMaterial" >
                  <td class="MaterialBoxname" >理论用量(Kg)</td>
                  <td class="MaterialBoxs1" v-for="item in tableData"    :key="item.fId"><el-input type="number" :disabled="isEdit" v-model="item.fLlyl"></el-input></td>
                  <td class="MaterialBox1" colspan="3"></td>
                  <td class="MaterialBox1" colspan="3"></td>
                  <td class="MaterialBox1" colspan="3"></td>
                </tr>
              </table>
              </div>
            </el-collapse-item>
          </el-collapse>
        </div>
        <div class="newlyAdded_btn" v-if="btnShow">
          <el-button :disabled="isLock" type="primary" @click="yj_saveForm(1)"
            >保存</el-button
          >
          <el-button type="warning" @click="visible = false">关闭</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script src="./index.js"></script>
<style lang="less" scoped>
@import "./index.less";
</style>
